import 'package:flutter/material.dart';
import 'package:upad/webview.dart';

void main() {
  runApp(MyApp());

  // 实现全屏
//  SystemChrome.setEnabledSystemUIOverlays([]);
}

class DisableScrollBehavior extends ScrollBehavior {
  @override
  Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
    return child;
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Webview(
      url: "http://zpad.xvc.com",
      withZoom: false,
      withLocalStorage: true,
      scrollBar: false,
      appCacheEnabled: true,
    );
  }
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: HomePage(),
        builder: (context, child) {
          return ScrollConfiguration(
            behavior: DisableScrollBehavior(),
            child: child,
          );
        });
  }
}
